package com.share.dao.attach.advertise.impl;

import java.util.LinkedHashMap;
import java.util.List;

import org.springframework.stereotype.Component;

import com.share.bean.attach.advertise.Advertise;
import com.share.commons.base.dao.BaseDaoSupport;
import com.share.dao.attach.advertise.AdvertiseDao;

@Component
public class AdvertiseDaoImpl extends BaseDaoSupport<Advertise> implements AdvertiseDao {

	@Override
	public void deleteAdvertiseDao(Object... ids) throws RuntimeException {
		this.deleteAllObject(Advertise.class, ids) ;
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Advertise> findAllAdvertiseDao(String hql,String whereHQL,List<Object> param,LinkedHashMap<String , String> orderby)
			throws RuntimeException {

		return (List<Advertise>) this.find(hql, whereHQL, param,orderby) ;
	}

	@Override
	public Advertise loadByIdAdvertiseDao(int id) throws RuntimeException {

		return this.loadById(Advertise.class, id) ;
	}

	@Override
	public void saveAdvertiseDao(Advertise ad) throws RuntimeException {
		this.saveObject(ad) ;
	}

	@Override
	public void updateAdvertiseDao(Advertise ad) throws RuntimeException {
		this.updateObject(ad) ;
	}

}
